package com.kingyun.gpsinspection.purificationservice.services.jsm.innerservice.impl.device;

import com.kingyun.gpsinspection.purificationservice.dao.mapper.jsm.DeviceRecordMapper;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.DeviceRecord;
import com.kingyun.gpsinspection.purificationservice.facade.service.jsm.device.JsmDeviceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 设备启停记录实现
 * @author zjh
 * @since 20170503
 */
public class JsmDeviceRecordServiceImpl implements JsmDeviceRecordService {
    @Autowired
    private DeviceRecordMapper deviceRecordMapper;
    /**
     * 新增设备启停记录
     *
     * @param deviceRecord 启停记录
     * @return
     */
    @Override
    @Transactional(propagation = Propagation.REQUIRED)
    public int addDeviceRecord(DeviceRecord deviceRecord) {
        return deviceRecordMapper.insert(deviceRecord);
    }


    /**
     *查询该设备的出库、启用、废弃的时间信息
     * @param deviceRecord
     * @return
     */
    public List<DeviceRecord> selectByDericeId(DeviceRecord deviceRecord){
        return deviceRecordMapper.selectByDericeId(deviceRecord);
    }
}
